use Radar
go

if exists (select * from sys.objects where name like 'Image' and type like 'U')
	drop table Image
go
if exists (select * from sys.objects where name like 'Capture' and type like 'U')
	drop table capture
go
if exists (select * from sys.objects where name like 'Params' and type like 'U')
	drop table params
go


create table Capture(
	id int identity,
	
	instant datetime,
	type varchar(250),
	speed real,
	plate varchar(250),
	wasSent bit,
	constraint pkCapture primary key (id)
)
go

create table Image(
	id int identity,
	captureId int,
	image varbinary(max),
	constraint fkImage foreign key (captureId) references Capture(id)
)
go

create table Params(
	id varchar(50),
	value varchar(50),
	constraint pkParams primary key (id)
)

--select * from capture
--select * from image